public class Java0922 {

        public int val;
        public Java0922 next;
        public Java0922 head;

        public Java0922(int val) {
            this.val = val;
        }

    public void creatList() {

        Java0922 node1 = new Java0922(12);
        Java0922 node2 = new Java0922(23);
        Java0922 node3 = new Java0922(34);
        Java0922 node4 = new Java0922(45);
        Java0922 node5 = new Java0922(56);



        node1.next = node2;  //将前一个结点的地址赋予给上一个结点的.next字段
        node2.next = node3;  //从而建立链接
        node3.next = node4;
        node4.next = node5;

        this.head = node1;

    }

    public void show() {
            Java0922 x = head;

            while (x != null){
                System.out.println(x.val);
                x = x.next;
    }
}
















}
